package com.stormrage.entity.rep;

import java.io.Serializable;

/**
 * @author www.stormragetech.com
 * @date 2016年3月18日
 * @version 1.0.0
 */
public class JsonRep implements Serializable {

	// ------------------------------- Fields -------------------------------

	private static final long serialVersionUID = 1240650858634673226L;

	// ------------------------------- Fields -------------------------------

	private Integer recordsTotal;

	private Integer recordsFiltered;

	private Integer draw;

	private Object data;

	// ------------------------------- Fields -------------------------------

	public JsonRep() {
	}

	// ------------------------------- Fields -------------------------------

	public Integer getRecordsTotal() {
		return recordsTotal;
	}

	public void setRecordsTotal(Integer recordsTotal) {
		this.recordsTotal = recordsTotal;
	}

	public Integer getRecordsFiltered() {
		return recordsFiltered;
	}

	public void setRecordsFiltered(Integer recordsFiltered) {
		this.recordsFiltered = recordsFiltered;
	}

	public Integer getDraw() {
		return draw;
	}

	public void setDraw(Integer draw) {
		this.draw = draw;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	// ------------------------------- Fields -------------------------------

	public static JsonRep instance(Integer count, Integer draw, Object data) {
		JsonRep entity = new JsonRep();
		entity.setRecordsTotal(count);
		entity.setRecordsFiltered(count);
		entity.setDraw(Integer.valueOf(draw));
		entity.setData(data);
		return entity;
	}

	@Override
	public String toString() {
		return this.getClass() + " : recordsTotal - " + recordsTotal + " recordsFiltered - " + recordsFiltered
				+ " draw - " + draw + " data - " + data;
	}

}